﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;

namespace Bootstrap5;

/// <summary>
/// 提示层。
/// </summary>
[CssClass("alert")]
partial class Alert : IHasChildContent
{
    /// <summary>
    /// 表示具备醒目的提示框。
    /// </summary>
    public Alert()
    {

    }

    [Parameter] [CssClass("alert-")] public Color Color { get; set; } = Color.Primary;

    [Parameter] [CssClass("alert-dismissible")] public bool Dismissible { get; set; }

    [Parameter] public RenderFragment HeadContent { get; set; }

    [Parameter]public RenderFragment ChildContent { get; set; }

    protected override void CreateCssClass(ICssClassBuilder builder)
    {
        builder.Add("fade show", Dismissible);
    }
}
